• Empleos
  • Sobre nosotros
  • Empleos
    • Inicio
    • Empleos
    • Cursos y retos
  • Empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Contrata talento tech
    • Blog
    • Comercial
    • Calculadora de salario

0

369
Vistas
How `instanceof` operator work in JavaScript, if we change the existing prototype of object?

I am learning how inheritance work in JavaScript and came across following situation.

enter image description here

If we change Ninja prototype completely with new Object then we lost the connection with old prototype. Look at the below picture.

enter image description here

Here we loose the connection with old prototype and it's old constructor function. Then how ninja instanceof Ninja assert to true? we don't have any direct connection with Ninja prototype.

Please tell me how instanceof operator find Ninja prototype on ninja object prototype chain?

over 3 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda